//
//  AXMyWdjsSchemeDetailsEightCell.m
//  AnXin100
//
//  Created by 天质弘耕 on 2018/11/8.
//  Copyright © 2018 tzhg. All rights reserved.
//

#import "AXMyWdjsSchemeDetailsEightCell.h"
#import "UIView+SDAutoLayout.h"
#import "ZXCategories.h"
#import "UITableView+SDAutoTableViewCellHeight.h"

@implementation AXMyWdjsSchemeDetailsEightCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self creatView];
        [self setlayout];
    }
    return self;
}

- (void)creatView {
    
    self.clearView = [[UIView alloc]init];
    [self.contentView addSubview:self.clearView];
    
    
    self.bgView = [[UIView alloc]init];
    self.bgView.cornerRadius = 5;
    self.bgView.backgroundColor = [UIColor whiteColor];
    [self.clearView addSubview:self.bgView];
    
    self.titleLabel = [[UILabel alloc]init];
    self.titleLabel.textAlignment = NSTextAlignmentLeft;
    self.titleLabel.text = @"方案说明";
    self.titleLabel.font = FONT_FOURTEEN;
    self.titleLabel.textColor = COLOR_DIV;
    [self.bgView addSubview:self.titleLabel];
    
    self.contentLabel1 = [[UILabel alloc]init];
    self.contentLabel1.font = FONT_FOURTEEN;
    self.contentLabel1.textColor = COLOR_Gray;
    [self.bgView addSubview:self.contentLabel1];
    
    self.startTimeLabel = [[UILabel alloc]init];
    self.startTimeLabel.font = FONT_FOURTEEN;
    self.startTimeLabel.textColor = COLOR_Gray;
    [self.clearView addSubview:self.startTimeLabel];
    
    self.endTimeLabel = [[UILabel alloc]init];
    self.endTimeLabel .font = FONT_FOURTEEN;
    self.endTimeLabel .textColor = COLOR_Gray;
    [self.clearView addSubview:self.endTimeLabel ];
    
    
    
}

- (void)setlayout {
    
    self.clearView.sd_layout
    .leftSpaceToView(self.contentView, 0)
    .topSpaceToView(self.contentView, 0)
    .widthIs(SCREEN_WIDTH)
    .heightIs(160);
    
    
    self.bgView.sd_layout
    .leftSpaceToView(self.clearView, 10)
    .topSpaceToView(self.clearView, 5)
    .widthIs(SCREEN_WIDTH-20)
    .heightIs(90);
    
    self.titleLabel.sd_layout
    .leftSpaceToView(self.bgView, 10)
    .topSpaceToView(self.bgView, 10)
    .widthIs(SCREEN_WIDTH-40)
    .heightIs(20);
    
    self.contentLabel1.sd_layout
    .leftSpaceToView(self.bgView, 10)
    .topSpaceToView(self.titleLabel, 10)
    .widthIs((SCREEN_WIDTH-20-30))
    .autoHeightRatio(0)
    .minHeightIs(40);
    
    
    self.startTimeLabel.sd_layout
    .leftSpaceToView(self.clearView, 20)
    .topSpaceToView(self.bgView, 10)
    .widthIs(SCREEN_WIDTH-20)
    .heightIs(20);
    
    self.endTimeLabel.sd_layout
    .leftSpaceToView(self.clearView, 20)
    .topSpaceToView(self.startTimeLabel, 10)
    .widthIs(SCREEN_WIDTH-20)
    .heightIs(20);
    
    
    
    
    [self setupAutoHeightWithBottomView:self.clearView bottomMargin:10];
    
    
}

-(void) setModel:(AXMyWdjsSchemeDetailModel *)model{
    _model=model;
    _contentLabel1.text=[NSString stringWithFormat:@"诊断结论：%@",_model.fExplain];
    
}


@end
